#ifndef XDATAMANAGER_H
#define XDATAMANAGER_H

#include <iostream>

class XResourcesManager
{
	public:
		XResourcesManager();
		void Init(sf::RenderWindow* app);
		void Close();

		// Data
		const int& GetInt(const std::string& dataname);
		const std::string& GetString(const std::string& dataname);

		void SetInt(const std::string& dataname, int value);
		void SetString(const std::string& dataname, std::string value);

		bool queueEmpty(std::string queue);
		const struct functions nextQueue(std::string queue);
		void NewQueue(std::string queue, std::string argument, std::string variable);

		// Images
		const sf::Image& GetImage(const std::string& filename);	

		// App
		sf::RenderWindow* GetApp();

		// Logger
		void NewLog(std::string log);
		void DisplayLogs(bool displayLogs);

		// Font
		sf::Font& GetFont();

		// Network
		void ReceivePackets();
		void SendPackets();
		void NewPacket(std::string function, std::string argument, std::string variable);
		bool Connect();

	private:
		// Data
		std::string x_dataDir;
		std::map<std::string, int> x_idata;
		std::map<std::string, std::string> x_sdata;
		std::map<std::string, std::queue<struct functions> > x_qdata;

		std::vector<std::string> x_cidata;
		std::vector<std::string> x_csdata;

		// Images
		std::map<std::string, sf::Image> x_images;

		// App
		sf::RenderWindow* x_app;

		// Logger
		std::vector<std::string> x_logs;
		bool x_displayLogs;

		// Font
		sf::Font x_font;

		// Network
		sf::SocketTCP x_socket;
};

#endif
